{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# DTW simple example"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Let's define our two sequences"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# We define two sequences x, y as numpy array\n",
    "# where y is actually a sub-sequence from x\n",
    "x = np.array([2, 0, 1, 1, 2, 4, 2, 1, 2, 0]).reshape(-1, 1)\n",
    "y = np.array([1, 1, 2, 4, 2, 1, 2, 0]).reshape(-1, 1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x11ad8a390>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAEICAYAAABPgw/pAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nOydeXxU1fn/30/2PYHsQ4CwQxIyqIj7iihLAgJq99af9mvtqlXrUq2tWm1ta1fbWlv7bfv99ls3QElYFAVxZ1FJSFjDmpA9QBIC2c/vj3ujQ0jIJJmZO8t5v17zYmbuuec8c8k8c+5znvN8RCmFRqPRaHyfIKsN0Gg0Go1r0A5do9Fo/ATt0DUajcZP0A5do9Fo/ATt0DUajcZP0A5do9Fo/ATt0DUaNyAiSkQmWm2HJrDQDt3HEZGbRWS7iJwUkWoR+bOIJLh4DLc7JxG5UkQq3DmGRuPvaI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pDoBO5WSmUBFwLfDvDrAXAHsNNqI7yE3wH/v727V40iDKM4/j8QCxNBbE2KpNJCkIiFGLAwdopXoIUXoFgJeg0idjYBG9PF1GJhn8IoCNqpxGjENH5go+CxmBEsEthmeXZmzq9apjoMO4eZd3bf54nt48BJBnpeJM0CN4DTtk/QbAPeyy2+O1XojDawejBs79jebD//oLlgZ2tT1ZE0B1wEVqqzVJN0GDhHM6sA279sf61NVWoKONhOVJsGPhXnGYuuFfpeA6sHW2D/kzQPLAIbtUlK3QduAX+qg0yABWAXeNguQa1ImqkOVcH2R+AusAXsAN9sP61NNR5dK/TYg6RDwGPgpu3v1XkqSLoEfLH9vDrLhJgCTgEPbC8CP4FBvnOSdITmSX4BOArMSLpSm2o8ulboowysHhRJB2jKfNX2enWeQkvAZUnvaZbizkt6VBup1DawbfvfE9saTcEP0QXgne1d27+BdeBscaax6FqhjzKwejAkiWaN9I3te9V5Ktm+bXvO9jzN9+KZ7V7ehY3C9mfgg6Rj7aFl4HVhpEpbwBlJ0+01s0xPXxCPNFN0Uuw3sLo4VqUl4CrwStLL9tiddgZsxHVgtb35eQtcK85TwvaGpDVgk+aXYS/o6RYA+et/RERPdG3JJSIi9pFCj4joiRR6RERPpNAjInoihR4R0RMp9IiInkihR0T0xF+XNwAT2tim8wAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(x, label='x')\n",
    "plt.plot(y, label='y')\n",
    "plt.title('Our two temporal sequences')\n",
    "plt.legend()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Compute the dynamic time warped distance between x and y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2.0"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from dtw import dtw\n",
    "\n",
    "# Here, we use L2 norm as the element comparison distance\n",
    "l2_norm = lambda x, y: (x - y) ** 2\n",
    "\n",
    "dist, cost_matrix, acc_cost_matrix, path = dtw(x, y, dist=l2_norm)\n",
    "\n",
    "dist"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### You can plot the accumulated cost matrix and the \"shortest\" wrap path."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAASsAAAD4CAYAAAC0ecCBAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAPdUlEQVR4nO3db2xd9X3H8c8H51a1c50wbR1sBA2EJixUSCgWC2MqDNaIrhXjwR6A1IRFExHS1pGpUtXuQaQ9zhS1D6aiiLabEpZqS4kEqMsSKa6iShtbCJhBQlHDqElGlkRTBzYIQvzdA19TJ7Hjc+3z73fO+yVFOLk39/e9OHnn3HP//BwRAoC6u6rqAQAgC2IFIAnECkASiBWAJBArAElYUcSNDg4OxurVq4u46cu8//77pawjSQMDA6WtJUlXXVXevyWdTqe0tdasWVPaWm+88UZpa3344YelrSWV+z374IMPSllnenpaEeH5LiskVqtXr9bGjRuLuOnLjI+Pl7KOJHW73dLWKnu9a665prS1tm/fXtpaGzZsKG2tEydOlLaWJF177bWlrVXW37MrRZGHgQCSQKwAJIFYAUgCsQKQBGIFIAnECkASiBWAJBArAEkgVgCSsGisbN9s++U5P961vbWM4QBg1qJvt4mIn0paJ0m2BySdkrSv4LkAJGxgYEAXLlzI9Tb7fRh4v6QTEfHzXKcA0BjDw8Pav3+/Nm/enOvt9hurhyXtme8C21tsH7F9pMxPQgBQH8PDw9q3b59GR0d17ty5XG87c6xsf0rSg5L+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q2O5oJ1dMR8UzV8+TkbkkP2n5LMw/Z77O9u9qRcnNS0smImD0C3quZeKXuDyT9V0ScjYjzkp6R9LsVz9S3OsSqkZuo2rZmzn0cj4gdVc+Tl4j4ZkSsiYgbNPO9OhQRyf0rPZ+IOC3pbds3937pfknHKhwpLxOS1tse6v25vF8JPnGQad/AIjV4E9W7JW2U9J+2X+792l/19mBEfX1V0tO9fzjflLS54nmWLSJesL1X0lHNPEv9khJ82w1vtwGQhDo8DASARRErAEkgVgCSQKwAJIFYAUgCsQKQBGIFIAn/D2P4XoBhHa2mAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.imshow(acc_cost_matrix.T, origin='lower', cmap='gray', interpolation='nearest')\n",
    "plt.plot(path[0], path[1], 'w')\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
